package 领扣算法.A简单题.重复的子字符串;

public class Main {
    //官方解法
    public boolean repeatedSubstringPatternr(String s) {

        String str = s + s;
        return str.substring(1, str.length() - 1).contains(s);
    }



    int len;
    public boolean repeatedSubstringPattern(String s) {
        if (s.length()<2)
            return true;
        StringBuffer res=new StringBuffer();
        for (int i = 0; i < (s.length()+1)/2; i++) {
            res.append(s.charAt(i));

            len = s.replaceAll(res.toString(), "").length();
            if (len==0)
                return true;
            else if (len==s.length())
                return false;
        }

        return false;
    }


    public static void main(String arg[]){//main--来自高金磊
        long time=System.currentTimeMillis();
        System.out.println(new Main().repeatedSubstringPattern("oyrvzggneabubhnnkigwntxjuvnfaskpsdkumshqsikwrzjchrawkxfesumvnymheybqqjgjtsfltqpbkpxwmfdhzrcmrowvmxleitnenurhngkzvhvjoasorwclmygywudenskdpbkchudedyqsbigufifrjmsfixlvrwagzkkhennkodcpokjvurmddgklfwixujdtvqccdqmtvqijaueultyqbidhgngawjwubywfqiaoylzafguszskcdnljarmzditeiplbzmpzxqzewvwxqgatvlevdqugapmlgymhkdgjthnqflpvtpqodujingqnvcyeamlmruvndkfivufokvcpqoxfunsrptvshhgzbcogotpknuyzqdqirnnnchguccmkluloyzunslxhgxjyazitnxgreplhrzreuessdofxacgicpgcpqyengvrvjamitscxkxabczbhgjjvrnmhlsusqnnzochhumfhjhiljlupudmlrbuctowjbkirmqziegpnnxawivneaartblywbugfeowsgxbkdqzrqapaxdfxfyrimpenlkuqbrkjoluscvluvcuufbsmalumczbnjwfmpqwfbszfnkzlpwfuxxhzkdlmcpcolhacxyhzqhgetgriewfbwobgrovwfxkqemuencfdlljetapxzubvkcdbsazyxlqeylinppqaacgwextdtuadyghtggrgsjkswufljxnlzwhetdjnzksaqztyimeavouskzfvwthyrqckvnzvzuvpvqodcufxjzrvaxrxsaxjsbvooxlorifmyvsaqxzbzrwzqpykrvvkwsalpnbivgxtcrvuouvnntpfjnpajkmfdosubtfwacretmyjjvzyooezdvcmgouldohgimdkqwqllqxwlyuzmybrudecrapwoydynikfearrqqnboidcietehzgazxzqycqlkbqqbjiuzvvpfarognspmbqoargytwjfxaxblfvldscivuybhrrvujjuartvoecngzoshjfkehuzdtcmkvigetaglvdbafoifdamohyupstslwfxtpdyiggvbkwdrlmwqokgwiblbwfoummodromxujbggeytqwjhjrdrsqurxllmzzpqpbqmnrstvsoorzvaqatlqqcpbpbarrsguishzlcvfqlwpiyiiutakxrnmtndmhkgqcqrpuoxlzvchukrqftaclnpecuqjeybjqtalhzyhvcqrpkhudhzowquykkjrllcdeeqleqsbtlukvbeykfngxhgkupdhahmeldqrtksoxmyspftzkihkrpunhxuhejormgjhsdwqswihbdjolsydisqprnyxwmokuxrndpdvmncntlbeebhotyfmnfjjsytoxkbacgvowybplftrgdhcdmqqsazmaucxggaimvykvcbjhxapaktfykvqmwemshjynjjbhhoejpnsoqioadvynqrboxnigzhtkqxrznwjclbrblhbpdcevvgmsvuzuduhvryvgwejkhcltlpiqroomucgsyfmcatxtuuasalcipqdcfnvybjmynsqlaepaanvujxokkruzhxeokzmnkalxsdisiauinseypskalebubfingwbqwonruylcyimnaqnpkyrwctsgadvhbyzynprjnclnkxcmppczpvxsqqarvvawuzwjopsdsfseeuttmxubssvjkxchtcdpbaaspuvjboqfkjaygucaozjyxlfspljrnjlefgqiwinjrnhzjjbyjlygygaorjhguskzaahziwiblpcubeumrvsrbufudocximylpfkzdudojhkmnhyecsyfmfbpudmerkpgrbiuvnkhuxvieuoimmnzsoqotfskpktjlbfjqqsknnuthjbwxoxpepfxuyjmkcvxfagvsaghoccxldvltscziiyciiqsklpsoyniyvsoyumlyjwtcztmjrqrzhlmsaeiarrbplpnfdydpxzrwsfflvyncjzxlfhoyapnlgarmbwbyvuwpzbbubozknyxuflsgagtjikxjjyjeufutixpjlqvaotuwemehuxsdkpotpyzjdtcostxdkvfaozwuocdkavnmkefzeeijamxsixyusduiftcvvgfxbvjozqndvymxmmpujnobtljyentbtabxvmlwdazaaoxnamhlcymxjxxnmsqisrfoeskhumhvcgieurpypdvycsnokewfvdtbvfkqttnvzvzumqsctocviqmvuiarovvjafbwbotalvualpehfgenwqisbkmpfjaiqeeruxsgsoggdknisryrkilltzayiaizemszmmhgbpogbbrtvpkfxwqsxsrgsbhzqzacmjkpyzvzcmuxdfcbdutammifqpggrikfruurvrqygmxjtamwuizhwhomzwsseexxbtowkgwssucmwqksalbxtplungmtklqlegkqmijhcnvafhtgtufomsizywvlhlynskdgtmpxbkyhstplpubbojdnhyaolabflgmgvddwqdfiwwvmqwphhswosweeyhljpxpkdvjtyqdvnajfyymftivlgbrfidoxcgkfdtybjbyybjeziqgbzdofeimmlbmpjwvorvrczqbcbfejxmmwqbeulqjwtvnetiumgmohepjfwnruadsqgymrrvpmsdtnnnztzoadfmjezaybfstmtifkfvyyyrnlfnhedjkivvoxxoachwqcewmjrkjrexejklppxbxuwottcuyjsolwkzhdmruqozbamspjuoescxoftmqlaejlfroriljykmawhrgdhmvmljrhvjsynclvvbmfmyfwkfttybwfpsradkhbwczlgkgbltgytlwfsrzqsvxjppmtbvuxxvjffpgskosdbpjtgilbflkvawodskbrfmxkbfemuxrvmarsketqpelrcbxulyoqklcnqgbkdtirvbkghfyzllsompkznyrzlvncboohhyyfbkljqlkdwcrkselfechqxwuakkjujizmumxmzhqxkjhenuluyskxogxbqhxbryolknylvqihzrlplwjjrvgfbfitofxhdntpataxliekzrzmqkxhffoilxebcbjioexqzyokiuuiowwegunozbwmycqddzltdimcicmrwibmexsltfzvhxhhaxmfyxzbilfqntjlcmagmstfysahskqsjdxicylkltdamomobovngougjxpbjgvslucnvqagjfhvtvkwjhlrxiyifnlovgigdnwydwgodnjykvxveineslmzaynwgycjlahqyoebdpaqnzltjyxcjkbkiriopkacnjulzandrpvgogaxfzbqjdctukklxmpkvlxvlkaebvlrbnrimsbwvfrrqdeppvblgygtliaodlggyxrkpsinxcgpfngxijirkqmvymjdzrlxockguuvuwdlcqsbbdjunbikbvuewnrwcugkqahmxkybbscevnyjoitpfpvcdmyhietzgalfkjindktzztkpcfghxblaqjjypezweldqwmgcyzbytnnvsuepxqrpzcqrgppmcsfbelddmgdfvscpohfozydydvrlngarbfsfsxkefpkcioswvzkuzqvcnoqavqswxmdpmovtffwnwomrnwomolrczhcwzwuwjynxoiqtqmhmatfprteigxkgeoednzbwxotnwjgmypyakesezwmgtyozouebthzsvuftgoiefgesmwwoukwpkmqagucabbsyyaseocivkonxnlnjxjzhxpidmmdppyqnykromblwszvfmioktptqhdutpzkhzauxkonyrbvjaqqobhywwundxjypijwklshyixwayrlakcqljrhflwlkflzqwxaisjgaieciwokiqbtbscgdztpgfpyboalgmrjuylfwbperszskbbpcwflbwldmmotyieuirzetrikjhfwkilneqagollbxbwxlastrtxkmfxwoeszmfmqyoymzlnznlwalqufmtrybowpuqogwczuqxisjyryjpyxiucuovurmrggjvnfzobqlkkwkbwtsvsarwwhsryekfktczbbnctbodzygwuztmzkjwubpsfzzrsbrvfgyyjocjnkfhjyvjkehgfwbmxaerexnlfnjpbnyqyfxjfturzbyfzztybzqfydseqcvtrvkrajbfcvyezwlaxezzepgeuzkmdffwapqczrjdoihpgssezrdfiljekuqpzxmcneeovqrlybdevviuonzyzlclfudgrrkgvrushmffpilkfwftjgrkrvyypbhjsrppimhpymwpxizcegypprcgpahgdopxfhmqtththeigojjuqjjfannpnuwqknpsubinwpggvqmjaxfsgrxjemaujwmtmclgdvwaleiivuuxszpaqojvamrjkdfwfsfjoblbhtjcpdbjdqkvevshhjssnzosstdgwqhelqibumkzcwujsnsbyktlkkgeflkectkpjuqfgdgjbduvqmxqysckekomvaqxtanfufmbktmmwijouieubifhsvtowjlrjawgijjuexiafsqbauvddclvaejyoxrzzohjzqefpmhugxxhtvmwzxuzcfzsertghbpittnjiudorbxmwkjvjfxnmwfrpzxwametiresniiglgtjsegdjfrvcyotxlqzawviqzcdjkkwsffkjoquthpxfgrfrjetfbdvdfbmqnlisqvbglvaumxbsqgmznffojcrqdggqrrijmlqzgstvpupidbhqjmgupakuitlzktkwhcxpuqkmmcupfbhoqokfovzwomxyijwpmteglrsztmpyowpemzlcumakzxkjhgyvbcbovuooifpybeeqdrsaetkfsvobdmwhqyvoujceotdsxhkbbcdfxnmqkatooqxgqswkebosutmsdwvebylynxqyzkonalvqfscjtqenmqoyrvzggneabubhnnkigwntxjuvnfaskpsdkumshqsikwrzjchrawkxfesumvnymheybqqjgjtsfltqpbkpxwmfdhzrcmrowvmxleitnenurhngkzvhvjoasorwclmygywudenskdpbkchudedyqsbigufifrjmsfixlvrwagzkkhennkodcpokjvurmddgklfwixujdtvqccdqmtvqijaueultyqbidhgngawjwubywfqiaoylzafguszskcdnljarmzditeiplbzmpzxqzewvwxqgatvlevdqugapmlgymhkdgjthnqflpvtpqodujingqnvcyeamlmruvndkfivufokvcpqoxfunsrptvshhgzbcogotpknuyzqdqirnnnchguccmkluloyzunslxhgxjyazitnxgreplhrzreuessdofxacgicpgcpqyengvrvjamitscxkxabczbhgjjvrnmhlsusqnnzochhumfhjhiljlupudmlrbuctowjbkirmqziegpnnxawivneaartblywbugfeowsgxbkdqzrqapaxdfxfyrimpenlkuqbrkjoluscvluvcuufbsmalumczbnjwfmpqwfbszfnkzlpwfuxxhzkdlmcpcolhacxyhzqhgetgriewfbwobgrovwfxkqemuencfdlljetapxzubvkcdbsazyxlqeylinppqaacgwextdtuadyghtggrgsjkswufljxnlzwhetdjnzksaqztyimeavouskzfvwthyrqckvnzvzuvpvqodcufxjzrvaxrxsaxjsbvooxlorifmyvsaqxzbzrwzqpykrvvkwsalpnbivgxtcrvuouvnntpfjnpajkmfdosubtfwacretmyjjvzyooezdvcmgouldohgimdkqwqllqxwlyuzmybrudecrapwoydynikfearrqqnboidcietehzgazxzqycqlkbqqbjiuzvvpfarognspmbqoargytwjfxaxblfvldscivuybhrrvujjuartvoecngzoshjfkehuzdtcmkvigetaglvdbafoifdamohyupstslwfxtpdyiggvbkwdrlmwqokgwiblbwfoummodromxujbggeytqwjhjrdrsqurxllmzzpqpbqmnrstvsoorzvaqatlqqcpbpbarrsguishzlcvfqlwpiyiiutakxrnmtndmhkgqcqrpuoxlzvchukrqftaclnpecuqjeybjqtalhzyhvcqrpkhudhzowquykkjrllcdeeqleqsbtlukvbeykfngxhgkupdhahmeldqrtksoxmyspftzkihkrpunhxuhejormgjhsdwqswihbdjolsydisqprnyxwmokuxrndpdvmncntlbeebhotyfmnfjjsytoxkbacgvowybplftrgdhcdmqqsazmaucxggaimvykvcbjhxapaktfykvqmwemshjynjjbhhoejpnsoqioadvynqrboxnigzhtkqxrznwjclbrblhbpdcevvgmsvuzuduhvryvgwejkhcltlpiqroomucgsyfmcatxtuuasalcipqdcfnvybjmynsqlaepaanvujxokkruzhxeokzmnkalxsdisiauinseypskalebubfingwbqwonruylcyimnaqnpkyrwctsgadvhbyzynprjnclnkxcmppczpvxsqqarvvawuzwjopsdsfseeuttmxubssvjkxchtcdpbaaspuvjboqfkjaygucaozjyxlfspljrnjlefgqiwinjrnhzjjbyjlygygaorjhguskzaahziwiblpcubeumrvsrbufudocximylpfkzdudojhkmnhyecsyfmfbpudmerkpgrbiuvnkhuxvieuoimmnzsoqotfskpktjlbfjqqsknnuthjbwxoxpepfxuyjmkcvxfagvsaghoccxldvltscziiyciiqsklpsoyniyvsoyumlyjwtcztmjrqrzhlmsaeiarrbplpnfdydpxzrwsfflvyncjzxlfhoyapnlgarmbwbyvuwpzbbubozknyxuflsgagtjikxjjyjeufutixpjlqvaotuwemehuxsdkpotpyzjdtcostxdkvfaozwuocdkavnmkefzeeijamxsixyusduiftcvvgfxbvjozqndvymxmmpujnobtljyentbtabxvmlwdazaaoxnamhlcymxjxxnmsqisrfoeskhumhvcgieurpypdvycsnokewfvdtbvfkqttnvzvzumqsctocviqmvuiarovvjafbwbotalvualpehfgenwqisbkmpfjaiqeeruxsgsoggdknisryrkilltzayiaizemszmmhgbpogbbrtvpkfxwqsxsrgsbhzqzacmjkpyzvzcmuxdfcbdutammifqpggrikfruurvrqygmxjtamwuizhwhomzwsseexxbtowkgwssucmwqksalbxtplungmtklqlegkqmijhcnvafhtgtufomsizywvlhlynskdgtmpxbkyhstplpubbojdnhyaolabflgmgvddwqdfiwwvmqwphhswosweeyhljpxpkdvjtyqdvnajfyymftivlgbrfidoxcgkfdtybjbyybjeziqgbzdofeimmlbmpjwvorvrczqbcbfejxmmwqbeulqjwtvnetiumgmohepjfwnruadsqgymrrvpmsdtnnnztzoadfmjezaybfstmtifkfvyyyrnlfnhedjkivvoxxoachwqcewmjrkjrexejklppxbxuwottcuyjsolwkzhdmruqozbamspjuoescxoftmqlaejlfroriljykmawhrgdhmvmljrhvjsynclvvbmfmyfwkfttybwfpsradkhbwczlgkgbltgytlwfsrzqsvxjppmtbvuxxvjffpgskosdbpjtgilbflkvawodskbrfmxkbfemuxrvmarsketqpelrcbxulyoqklcnqgbkdtirvbkghfyzllsompkznyrzlvncboohhyyfbkljqlkdwcrkselfechqxwuakkjujizmumxmzhqxkjhenuluyskxogxbqhxbryolknylvqihzrlplwjjrvgfbfitofxhdntpataxliekzrzmqkxhffoilxebcbjioexqzyokiuuiowwegunozbwmycqddzltdimcicmrwibmexsltfzvhxhhaxmfyxzbilfqntjlcmagmstfysahskqsjdxicylkltdamomobovngougjxpbjgvslucnvqagjfhvtvkwjhlrxiyifnlovgigdnwydwgodnjykvxveineslmzaynwgycjlahqyoebdpaqnzltjyxcjkbkiriopkacnjulzandrpvgogaxfzbqjdctukklxmpkvlxvlkaebvlrbnrimsbwvfrrqdeppvblgygtliaodlggyxrkpsinxcgpfngxijirkqmvymjdzrlxockguuvuwdlcqsbbdjunbikbvuewnrwcugkqahmxkybbscevnyjoitpfpvcdmyhietzgalfkjindktzztkpcfghxblaqjjypezweldqwmgcyzbytnnvsuepxqrpzcqrgppmcsfbelddmgdfvscpohfozydydvrlngarbfsfsxkefpkcioswvzkuzqvcnoqavqswxmdpmovtffwnwomrnwomolrczhcwzwuwjynxoiqtqmhmatfprteigxkgeoednzbwxotnwjgmypyakesezwmgtyozouebthzsvuftgoiefgesmwwoukwpkmqagucabbsyyaseocivkonxnlnjxjzhxpidmmdppyqnykromblwszvfmioktptqhdutpzkhzauxkonyrbvjaqqobhywwundxjypijwklshyixwayrlakcqljrhflwlkflzqwxaisjgaieciwokiqbtbscgdztpgfpyboalgmrjuylfwbperszskbbpcwflbwldmmotyieuirzetrikjhfwkilneqagollbxbwxlastrtxkmfxwoeszmfmqyoymzlnznlwalqufmtrybowpuqogwczuqxisjyryjpyxiucuovurmrggjvnfzobqlkkwkbwtsvsarwwhsryekfktczbbnctbodzygwuztmzkjwubpsfzzrsbrvfgyyjocjnkfhjyvjkehgfwbmxaerexnlfnjpbnyqyfxjfturzbyfzztybzqfydseqcvtrvkrajbfcvyezwlaxezzepgeuzkmdffwapqczrjdoihpgssezrdfiljekuqpzxmcneeovqrlybdevviuonzyzlclfudgrrkgvrushmffpilkfwftjgrkrvyypbhjsrppimhpymwpxizcegypprcgpahgdopxfhmqtththeigojjuqjjfannpnuwqknpsubinwpggvqmjaxfsgrxjemaujwmtmclgdvwaleiivuuxszpaqojvamrjkdfwfsfjoblbhtjcpdbjdqkvevshhjssnzosstdgwqhelqibumkzcwujsnsbyktlkkgeflkectkpjuqfgdgjbduvqmxqysckekomvaqxtanfufmbktmmwijouieubifhsvtowjlrjawgijjuexiafsqbauvddclvaejyoxrzzohjzqefpmhugxxhtvmwzxuzcfzsertghbpittnjiudorbxmwkjvjfxnmwfrpzxwametiresniiglgtjsegdjfrvcyotxlqzawviqzcdjkkwsffkjoquthpxfgrfrjetfbdvdfbmqnlisqvbglvaumxbsqgmznffojcrqdggqrrijmlqzgstvpupidbhqjmgupakuitlzktkwhcxpuqkmmcupfbhoqokfovzwomxyijwpmteglrsztmpyowpemzlcumakzxkjhgyvbcbovuooifpybeeqdrsaetkfsvobdmwhqyvoujceotdsxhkbbcdfxnmqkatooqxgqswkebosutmsdwvebylynxqyzkonalvqfscjtqenmq"));
        System.err.println(System.currentTimeMillis()-time);
    }
}
